package xyz.itpath.gen.autoconfigure;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import xyz.itpath.gen.util.StringUtils;

/**
 * @author zhaom
 * @date 2021/9/27 - 14:56
 */
@Setter
@Getter
@Configuration
@ConfigurationProperties(prefix = "itpath")
public class ProjectConfiguration {

    /**
     * 项目所在位置
     */
    private String projectLocation;

    /**
     * dao使用类型
     */
    private String typeDao = "mybatis-plus";

    /**
     * 数据库类型
     */
    private String typeDb = "mysql";

    /**
     * 表前缀
     */
    private String tablePrefix = "";

    public void setTypeDb(String typeDb) {
        if (!StringUtils.isBlank(typeDb)) {
            this.typeDb = typeDb;
        }
    }

    public void setTypeDao(String typeDao) {
        if (!StringUtils.isBlank(typeDao)) {
            this.typeDao = typeDao;
        }
    }
}
